Skip to content

Add parametrized package manager roundtrip integration test - #1687

Open
edvilme wants to merge 1 commit into
mainfrom
package-manager-roundtrip-integration-tests
Open

Add parametrized package manager roundtrip integration test#1687
edvilme wants to merge 1 commit into
mainfrom
package-manager-roundtrip-integration-tests

Conversation

@edvilme

@edvilme edvilme commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a parametrized integration test that verifies every discovered package manager performs a full package lifecycle correctly, using only the public extension API.

Roundtrip (per manager, all via the public API)

  1. getPackages — baseline (test package absent)
  2. managePackages({ install }) — install the test package
  3. refreshPackages + getPackages — test package now present
  4. direct dependencies — derived from Package.isTransitive
  5. managePackages({ uninstall }) — uninstall
  6. getPackages — test package absent again

Design

  • No custom harness. The test drives only the exported PythonEnvironmentApi.
  • Parametrized by discovery. Environments are grouped by envId.managerId (one representative per manager, preferring venv-like/modifiable envs), so any future package manager is exercised automatically with no per-manager code.
  • Failures are aggregated and reported per manager; managers without a usable package manager, or where the test package is already present, are skipped gracefully.
  • Best-effort finally cleanup guarantees the environment is never left dirty.

Known limitation

  • Available versions is intentionally not exercised. getPackageAvailableVersions (and getDirectPackageNames) live only on the internal PackageManager interface and are not surfaced on the exported PythonEnvironmentApi, so they are unreachable from a public-API-only test. Direct (non-transitive) packages are still covered because Package.isTransitive is public.

Testing

  • npm run compile-tests
  • npm run lint (new file clean)
  • Full roundtrip runs in the extension host via npm run integration-test (CI).

Adds a single public-API-driven integration test that exercises an
install/list/direct-deps/uninstall roundtrip for every discovered package
manager. Parametrized over environments grouped by managerId so future
managers are covered automatically with no per-manager code. Available
versions is omitted because it is not on the exported PythonEnvironmentApi.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant